<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">

<head>
  <title></title>
  <meta charset="utf-8">
  <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  <link rel="stylesheet" href="css/project/ui-res-v3.css">
  <link rel="stylesheet" href="css/project/ui-input-v3.css">
  <link rel="stylesheet" href="css/project/ui-color-v3.css">
  <link rel="stylesheet" href="css/project/style.css">
  <link rel="stylesheet" href="css/ui-base.css">
  <link rel="stylesheet" href="css/ui-box.css">
  <link rel="stylesheet" href="css/zv_common.css">
  <script src="js/jquery-3.1.1.min.js"></script>
  <script src="js/zy_control.js"></script>
  <script src="js/zy_click.js"></script>
  <script src="js/zy_json.js"></script>
  <script src="js/jquery.xml2json.js"></script>
  <script src="js/main.js?v=123"></script>
  <script src="js/init.js"></script>
  <script type="text/javascript" src="js/JsonSQL/jsonsql-0.1.js"></script>
  <script src="js/talkingdata.js"></script>
  <style type="text/css">
    .zv_noticebo {
      border-bottom: 1px solid #e5e5e5;
    }

    .zv_imc {
      background: #789de2;
      color: #fff
    }

    .zv_imc1 {
      background: #f2f2f2;
      color: #333333
    }

    .zv_imcline {
      background: #789de2;
      color: #fff;
      border-right: 1px solid #fff;
    }

    .zv_imcline1 {
      color: #333333;
      border-bottom: 1px solid #789de2;
      border-left: 1px solid #789de2;
    }

    .zv_imcline2 {
      border-right: 1px solid #789de2;
    }

    .zv_imcline3 {
      border: 1px solid #789de2;
      background: #ffcc00;
    }

    .zv_imvcb ul li {}

    .zv_imvcli {
      border: 1px solid #00ff00;
    }
    /* starWrapper */

    .starWrapper {
      width: 320px;
      height: 40px;
      overflow: hidden;
      margin: 0 auto;
      padding: 0 0.5em
    }

    .starWrapper img {
      cursor: pointer;
      float: left;
      margin: 0 2px 0 0;
      display: inline;
    }
  </style>
</head>

<body class="ub um-vp c-wh2 ub-ver" ontouchstart id="body">
  <div class="ub ub-ver">
    <div id="monitoring_list">
    </div>
    <input type="hidden" id="intelligent_id" value="">
  </div>
</body>
<script>
  zy_init();
  window.uexOnload = function(type) {
    if (!type) {
      uexWindow.setBounce("0");
      IC.talkingDataCount("智能监控", "0019");
    }
    monitoring_list()
  }

  function myrefresh() {
    // window.location.reload();//刷新
    ueppscript("intelligent_monitoring_search", "content", "LoadDataS('1')");
  }

  function monitoring_list() { //查询服务器时间
    Loading(0);
    var wsdl = ceair_server_time_url
    var nameSpace = ceair_server_time_nameSpace
    var paras = "|";
    var values = "|";
    var method = ceair_server_time_function
    var jsonPage = [{
      'key': 'wsdl',
      'type': '0',
      'value': wsdl
    }, {
      'key': 'KEY1',
      'type': '0',
      'value': '1'
    }, {
      'key': 'KEY2',
      'type': '0',
      'value': '1'
    }, {
      'key': 'KEY3',
      'type': '0',
      'value': '1'
    }, {
      'key': 'nameSpace',
      'type': '0',
      'value': nameSpace
    }, {
      'key': 'method',
      'type': '0',
      'value': method
    }, {
      'key': 'paras',
      'type': '0',
      'value': paras
    }, {
      'key': 'values',
      'type': '0',
      'value': values
    }];
    $.getJSON(UrlClient + "&SOAPType=yes", function(json) {
      //alert(json);
      monitoring_lists(json)
    }, "json", function(e) {}, "POST", jsonPage, false);
  }

  function monitoring_lists(Server_data) {
    var json = localStorage.getItem("zvData");
    //console.log(json);
    var jsonstr = json.replace('{"Rows":', '{"items":'); //字符替换
    jsonstr = "{\"data\": " + jsonstr + "}";
    var json = strToJson(jsonstr);
    //alert(JSON.stringify(json));
    var NewDataSet = jsonsql.query("select * from json.data.items where (OPERATIONNAME!='' & OPERATIONPLANNEDEND!='')  order by OPERATIONPLANNEDEND asc", json);
    //console.log(NewDataSet.length);
    //进港航班,航班计划结束时间（计划起飞时间）不能为空；航班计划结束时间（计划起飞时间）不能为空正序
    //var jsonStr = JSON.stringify(jsondata);
    //var jsondata = strToJson(jsonstr);
    //var NewDataSet = jsondata.data.items
    //alert('NewDataSet'+NewDataSet)
    if (NewDataSet.length <= 0) {
      Loading(-1);
      var b_height = $$("body").offsetHeight
      document.getElementById("monitoring_list").innerHTML = '<div  style="width:100%; text-align:center;line-height:' + b_height + 'px;"><img src="images/nodata.png" style="width:40%; text-align:center;"></div>'
    }
    var Flight = new Array();
    var strx = ''
    for (var s = 0; s < NewDataSet.length; s++) {
      Flight[s] = NewDataSet[s].OPERATIONNAME + "|" + NewDataSet[s].OPERATIONPLANNEDEND
    }
    var FlightAll = Flight.reverse().join(",").match(/([^,]+)(?!.*\1)/ig).reverse(); //去重复
    var json = strToJson(jsonstr);

    for (var z = 0; z < FlightAll.length; z++) {
      var flight_time = FlightAll[z]; //条件
      var strs = FlightAll[z].split("|");
      var strs1 = strs[0]
      var strs2 = strs[1]
      var data = jsonsql.query("select * from json.data.items where (OPERATIONNAME=='" + strs1 + "' & OPERATIONPLANNEDEND=='" + strs2 + "')  order by OPERATIONPLANNEDEND asc", json);
      var data = jsonsql.query("select * from json.data.items where (OPERATIONNAME=='" + strs1 + "' & OPERATIONPLANNEDEND=='" + strs2 + "')  order by OPERATIONPLANNEDEND asc", json);
      //console.log(data.length);
      //var jsonStr = JSON.stringify(data);
      var OPERATIONNAME = data[0].OPERATIONNAME //进港航班
      var OPERATIONEXTERNALNAME = data[0].OPERATIONEXTERNALNAME //出港航班
      if (OPERATIONEXTERNALNAME == 'undefined' || OPERATIONEXTERNALNAME == undefined || OPERATIONEXTERNALNAME == '') {
        OPERATIONEXTERNALNAME = ''
      } else {
        OPERATIONEXTERNALNAME = '/' + OPERATIONEXTERNALNAME
      }
      var PREVIOUSSTATION = data[0].PREVIOUSSTATION //前站编码
      if (PREVIOUSSTATION == 'undefined' || PREVIOUSSTATION == undefined || PREVIOUSSTATION == '' || PREVIOUSSTATION == null) {
        PREVIOUSSTATION = ''
      }
      var CURRENTSTATION = data[0].CURRENTSTATION //本站编码
      if (CURRENTSTATION == 'undefined' || CURRENTSTATION == undefined || CURRENTSTATION == '' || CURRENTSTATION == null) {
        CURRENTSTATION = ''
      } else {
        if (PREVIOUSSTATION != '') {
          CURRENTSTATION = "-" + CURRENTSTATION
        }
      }
      var NEXTSTATION = data[0].NEXTSTATION //到站编码
      if (NEXTSTATION == 'undefined' || NEXTSTATION == undefined || NEXTSTATION == '' || NEXTSTATION == null) {
        NEXTSTATION = ''
      } else {
        if (PREVIOUSSTATION != '' & CURRENTSTATION != '') {
          NEXTSTATION = "-" + NEXTSTATION
        }
      }
      var codin = PREVIOUSSTATION + CURRENTSTATION + NEXTSTATION
      var OPERATIONINTERNALNAME = data[0].OPERATIONINTERNALNAME //机号
      var OPERATIONEQUIPMENT = data[0].OPERATIONEQUIPMENT //机型
      var LOCATION = data[0].LOCATION //机位
      ////////////////////////////////头部日期、计划起飞开始
      var OPERATIONPLANNEDEND = data[0].OPERATIONPLANNEDEND //航班计划结束时间（计划起飞时间）
      var date_of = ''
      var time_of = ''
      if (OPERATIONPLANNEDEND != '' && OPERATIONPLANNEDEND != 'undefined' && OPERATIONPLANNEDEND != undefined) {
        if (OPERATIONPLANNEDEND.indexOf("Z") > 0) {
          var timej = ceair_Greenwich_time(OPERATIONPLANNEDEND)
          timej = zv_detailed(timej)
          date_of = timej.substring(0, 10); //截取
          time_of = timej.substring(11, 16); //截取
        } else {
          var strs = OPERATIONPLANNEDEND.split("T"); //字符分割
          date_of = strs[0]
          time_of = strs[1]
          time_of = time_of.substring(0, 5); //截取
        }
      } else {
        var OPERATIONACTUALEND = data[0].OPERATIONACTUALEND //航班实际结束时间（实际起飞时间）
        if (OPERATIONACTUALEND != '' && OPERATIONACTUALEND != 'undefined' && OPERATIONACTUALEND != undefined) {
          if (OPERATIONACTUALEND.indexOf("Z") > 0) {
            var timej = ceair_Greenwich_time(OPERATIONACTUALEND)
            timej = zv_detailed(timej)
            date_of = timej.substring(0, 10); //截取
            time_of = timej.substring(11, 16); //截取
          } else {
            var strs = OPERATIONACTUALEND.split("T"); //字符分割
            date_of = strs[0]
            time_of = strs[1]
            time_of = time_of.substring(0, 5); //截取
          }
        }
      }
      ////////////////////////////////头部日期、计划起飞结束
      ////////////////////////////////前站落地开始
      var OPERATIONACTUALSTART = data[0].OPERATIONACTUALSTART //航班实际开始时间（前站落地时间）
      var OPERATIONESTIMATEDSTART = data[0].OPERATIONESTIMATEDSTART //航班预计开始时间（预计到达时间）
      var OPERATIONPLANNEDSTART = data[0].OPERATIONPLANNEDSTART //航班计划开始时间（计划到达时间）
      var before_time = ''
      var qianzhan_time = '' //前站落地时间戳

      if (OPERATIONACTUALSTART != '' && OPERATIONACTUALSTART != 'undefined' && OPERATIONACTUALSTART != undefined) //航班实际开始时间（前站落地时间）
      {
        if (OPERATIONACTUALSTART.indexOf("Z") > 0) {
          var timeq = ceair_Greenwich_time(OPERATIONACTUALSTART)
          qianzhan_time = timeq //前站落地时间戳
          timeq = zv_detailed(timeq)
          before_time = timeq.substring(11, 16); //截取
        } else {
          qianzhan_time = ceair_time(OPERATIONACTUALSTART)
          qianzhan_time = zv_transdate(qianzhan_time) //前站落地时间戳
          before_time = OPERATIONACTUALSTART.split("T");
          before_time = before_time[1]
          before_time = before_time.substring(0, 5);
        }
      } else if (OPERATIONESTIMATEDSTART != '' && OPERATIONESTIMATEDSTART != 'undefined' && OPERATIONESTIMATEDSTART != undefined) //航班预计开始时间（预计到达时间）
      {
        if (OPERATIONESTIMATEDSTART.indexOf("Z") > 0) {
          var timeq = ceair_Greenwich_time(OPERATIONESTIMATEDSTART)
          qianzhan_time = timeq //前站落地时间戳
          timeq = zv_detailed(timeq)
          before_time = timeq.substring(11, 16); //截取
        } else {
          qianzhan_time = ceair_time(OPERATIONESTIMATEDSTART)
          qianzhan_time = zv_transdate(qianzhan_time) //前站落地时间戳
          before_time = OPERATIONESTIMATEDSTART.split("T");
          before_time = before_time[1]
          before_time.substring(0, 5);
        }
      } else {
        if (OPERATIONPLANNEDSTART != '' && OPERATIONPLANNEDSTART != 'undefined' && OPERATIONPLANNEDSTART != undefined) {
          if (OPERATIONPLANNEDSTART.indexOf("Z") > 0) {
            var timeq = ceair_Greenwich_time(OPERATIONPLANNEDSTART)
            qianzhan_time = timeq //前站落地时间戳
            timeq = zv_detailed(timeq)
            before_time = timeq.substring(11, 16); //截取
          } else {
            qianzhan_time = ceair_time(OPERATIONPLANNEDSTART)
            qianzhan_time = zv_transdate(qianzhan_time) //前站落地时间戳
            before_time = OPERATIONPLANNEDSTART.split("T");
            before_time = before_time[1]
            before_time = before_time.substring(0, 5);
          }
        }
      }
      ////////////////////////////////前站落地结束
      ////////////////////////////////预离开始
      var OPERATIONESTIMATEDEND = data[0].OPERATIONESTIMATEDEND //航班预计结束时间（预离时间）
      var pre_time = ''
      if (OPERATIONESTIMATEDEND != '' && OPERATIONESTIMATEDEND != 'undefined' && OPERATIONESTIMATEDEND != undefined) //航班预计结束时间（预离时间）
      {
        if (OPERATIONESTIMATEDEND.indexOf("Z") > 0) {
          var pre_time = ceair_Greenwich_time(OPERATIONESTIMATEDEND)
          pre_time = zv_detailed(pre_time)
          pre_time = pre_time.substring(11, 16); //截取
        } else {
          pre_time = OPERATIONESTIMATEDEND.split("T");
          pre_time = pre_time[1]
          pre_time = pre_time.substring(0, 5);
        }
      }
      ////////////////////////////////预离结束
      ////////////////////////////////目标保障开始
      var stood_ground = data[0].OPERATIONACTUALSTART //航班实际开始时间（前站落地时间）
      var ensure_time = '' //目标保障时间戳
      var plan_time = data[0].OPERATIONPLANNEDEND //航班计划结束时间（计划起飞时间）
      var planning_departure_time = ''
      if (plan_time != '' && plan_time != 'undefined' && plan_time != undefined) {
        if (plan_time.indexOf("Z") > 0) {
          planning_departure_time = ceair_Greenwich_time(plan_time) //计划起飞时间戳
        } else {
          planning_departure_time = ceair_time(planning_departure_time)
          planning_departure_time = zv_transdate(planning_departure_time) //计划起飞时间戳
        }
      }
      if (stood_ground != '' && stood_ground != 'undefined' && stood_ground != undefined) //航班实际开始时间（前站落地时间）
      {
        var standard = '0' //默认标准过站时间分钟
        var zv_where = 'Code=="' + OPERATIONEQUIPMENT + '"'

        if (OPERATIONEQUIPMENT.length > 3) //判断机型字符长度是否大于3
        {
          var str1 = OPERATIONEQUIPMENT.substring(0, 3) //取机型前3位
          var str2 = OPERATIONEQUIPMENT.substring(1, 4) //取机型后3位
          zv_where = 'Code=="' + str1 + '"||Code=="' + str2 + '"'
        }
        var Class_Data = localStorage.getItem("Class_Data");
        var ajson = strToJson(Class_Data);
        var Coderes = jsonsql.query("select * from json.data.items where (" + zv_where + ") ", ajson);
        for (var f = 0; f < Coderes.length; f++) {
          standard = Coderes[f].TagName //标准过站时间分钟
        }
        if (stood_ground.indexOf("Z") > 0) {
          var stood_time = ceair_Greenwich_time(OPERATIONACTUALSTART) //前站落地时间戳
          ensure_time = stood_time + standard * 60 //前站落地时间戳
        } else {
          var stood_time = ceair_time(stood_ground)
          stood_time = zv_transdate(stood_time)
          ensure_time = stood_time + standard * 60 //前站落地时间戳
        }
        if (ensure_time < planning_departure_time) {
          ensure_time = planning_departure_time
        }
      } else {
        ensure_time = planning_departure_time
      }
      var ensure_date = ''
      if (ensure_time != '') {
        ensure_date = zv_detailed(ensure_time)
        ensure_date = ensure_date.substring(11, 16); //截取
      }
      var type_display = $$("intelligent_id").value;
      var type_block = ' display:block;';
      var type_none = ' display:none;';
      if (type_display != '' && type_display != 'undefined' && type_display != undefined) //刷新后状态
      {
        if (type_display.indexOf(flight_zvid) >= 0) {
          var type_block = ' display:none;';
          var type_none = ' display:block;';
        }


      }
      var flight_zvid = OPERATIONNAME + OPERATIONEXTERNALNAME + OPERATIONPLANNEDEND

      ////////////////////////////////目标保障结束
      strx += '<div   id="intelligent_block' + flight_zvid + '"  style="' + type_block + ' line-height:1.4em;background:#FFF; margin-top:0.5em"  onclick="zv_block(\'' + flight_zvid + '\');">'
      strx += '<div class="ub ub-ac uinn zv_noticebo"  >'
      strx += '<div class="ub-f2  ub ub-ver"  style="width:70%">'
      strx += '<div class=" zv_noticefont1"  style="height:1.6em; line-height:1.6em;">' + OPERATIONNAME + OPERATIONEXTERNALNAME + '</div>'
      strx += '</div>'
      strx += '<div class="ub-f1  tx-r  ulev-1 zv_noticefont3" style="width:30%"><div style="float:left;text-align:right;width:75%">' + date_of +
        '</div><div style="float:right;width:25%"><img src="images/xia.png"   style="width:0.8em"  ></div></div>'
      strx += '</div>'
      strx += '</div>'

      strx += '<div id="intelligent_none' + flight_zvid + '" style="' + type_none + 'background:#FFF;" >'
      strx += '<div class="uinn1  zv_imc "  onclick="zv_none(\'' + flight_zvid + '\');">'
      strx += '<ul class=" ub ub-ac lis zv_h ulev0" >'
      strx += '<div class="ub-f2  ub ub-ver"  style="width:70%">'
      strx += '<div class=" zv_noticefont1"  style="height:1.6em; line-height:1.6em;">' + OPERATIONNAME + OPERATIONEXTERNALNAME + '</div>'
      strx += '</div>'
      strx += '<div class="ub-f1  tx-r  ulev-1 zv_noticefont3" style="width:30%"><div style="float:left;text-align:right;width:75%">' + date_of +
        '</div><div style="float:right;width:25%; "><img src="images/shou.png"   style="width:0.8em"  ></div></div>'
      strx += '</ul>'
      strx += '</div>'
      strx += '<div class="ub-ac ub uinn1 umar-t">'
      strx += '<div class="ub ub-ver ub-f1">'
      strx += '<div class="uc-t zv_h1 zv_imcline tx-c ">前站落地</div>'
      strx += '<div class="zv_h1 zv_imcline1 tx-c">' + before_time + '</div>'
      strx += '</div>'
      strx += '<div class="ub ub-ver ub-f1">'
      strx += '<div class="uc-t zv_h1 zv_imcline tx-c ">计划起飞</div>'
      strx += '<div class="zv_h1 zv_imcline1 tx-c">' + time_of + '</div>'
      strx += '</div>'
      strx += '<div class="ub ub-ver ub-f1">'
      strx += '<div class="uc-t zv_h1 zv_imcline tx-c ">预　　离</div>'
      strx += '<div class="zv_h1 zv_imcline1 tx-c">' + pre_time + '</div>'
      strx += '</div>'
      strx += '<div class="ub ub-ver ub-f1">'
      strx += '<div class="uc-t zv_h1 zv_imc tx-c ">目标保障</div>'
      strx += '<div class="zv_h1 zv_imcline1 zv_imcline2 tx-c">' + ensure_date + '</div>'
      strx += '</div>'
      strx += '</div>'
      strx += '<div class="ub-ac ub uinn1 umar-t">'
      strx += '<div class="ub ub-ver ub-f1">'
      strx += '<div class="uc-t zv_h1 zv_imcline tx-c ">航　　段</div>'
      strx += '<div class="zv_h1 zv_imcline1 tx-c">' + codin + '</div>' //
      strx += '</div>'
      strx += '<div class="ub ub-ver ub-f1">'
      strx += '<div class="uc-t zv_h1 zv_imcline tx-c ">机型/机号</div>'
      strx += '<div class="zv_h1 zv_imcline1 tx-c">' + OPERATIONEQUIPMENT + '/' + OPERATIONINTERNALNAME + '</div>'
      strx += '</div>'
      strx += '<div class="ub ub-ver ub-f1">'
      strx += '<div class="uc-t zv_h1 zv_imcline tx-c ">机　　位</div>'
      strx += '<div class="zv_h1 zv_imcline1 zv_imcline2 tx-c">' +LOCATION + '</div>'
      strx += '</div>'
      strx += '<div class="ub-f1 uc-a tx-c zv_imcline3" style="height:4em; line-height:4em; margin-left:0.1em" ontouchstart="zy_touch()" onclick="LoadDataS(\'' + flight_time + '\',\'' + OPERATIONNAME + '\',\'' + date_of + '\',\'' + data[0].OPERATIONID + '\');">打开视图</div>'
      strx += '</div>'
      //时间轴程序开始
      var actual_takeoff_time = data[0].OPERATIONACTUALEND //航班实际结束时间（实际起飞时间）
      var actual_takeoff_stamp = '' //实际起飞时间戳
      if (actual_takeoff_time != '' && actual_takeoff_time != 'undefined' && actual_takeoff_time != undefined) {
        if (actual_takeoff_time.indexOf("Z") > 0) {
          actual_takeoff_stamp = ceair_Greenwich_time(actual_takeoff_time) //实际起飞时间戳
        } else {
          actual_takeoff_stamp = ceair_time(actual_takeoff_time)
          actual_takeoff_stamp = zv_transdate(actual_takeoff_stamp) //实际起飞时间戳
        }
      } else { //无实际起飞 计划起飞时间戳
        var take_off_stamp = data[0].OPERATIONPLANNEDEND //航班计划结束时间（计划起飞时间）
        if (take_off_stamp != '' && take_off_stamp != 'undefined' && take_off_stamp != undefined) {
          if (take_off_stamp.indexOf("Z") > 0) {
            actual_takeoff_stamp = ceair_Greenwich_time(take_off_stamp) //计划起飞时间戳
          } else {
            actual_takeoff_stamp = ceair_time(take_off_stamp)
            actual_takeoff_stamp = zv_transdate(actual_takeoff_stamp) //计划起飞时间戳
          }
        }
      }
      //qianzhan_time前站落地时间戳
      //ensure_time目标保障时间戳
      //actual_takeoff_stamp实际起飞时间戳
      var Server_data = String(Server_data);
      var system_time = zv_transdate(Server_data);
      //alert(zv_detailed(system_time))
      //var system_time = Date.parse(new Date());//当前系统时间戳
      //system_time = system_time / 1000//当前系统时间戳
      if (system_time > actual_takeoff_stamp) {
        system_time = actual_takeoff_stamp
      }
      var qianzhan_time_date = zv_detailed(qianzhan_time)
      qianzhan_time_date = qianzhan_time_date.substring(11, 16) //前站落地时间
      var ensure_time_date = zv_detailed(ensure_time)
      ensure_time_date = ensure_time_date.substring(11, 16) //目标保障时间
      var system_time_date = zv_detailed(system_time)
      system_time_date = system_time_date.substring(11, 16) //系统时间
      var stood_name = '前站落地' //前站名字
      var ensure_starting = ensure_time - qianzhan_time //计算是否大于三小时
      if (ensure_starting > 10800) {
        stood_name = '保障起始' //前站名字
      }
      if (ensure_time > system_time) //目标保障时间>当前系统时间
      {
        var ensure_name = '当前时间' //中间轴名称
        var current_name = '目标保障' //后端轴名称
        var ensure_name_time = system_time_date //中间轴时间
        var current_name_time = ensure_time_date //后端轴时间
        var time_color = '#f0f000'
        if (system_time > qianzhan_time) {
          var percentage1 = system_time - qianzhan_time
          var percentage2 = ensure_time - system_time
          var percentage_total = percentage1 + percentage2
          var percentage1_val = percentage1 / percentage_total * 100 //时间轴一
          var percentage2_val = percentage2 / percentage_total * 100 //时间轴二
        } else {
          var percentage1_val = 0 //时间轴一
          var percentage2_val = 100 //时间轴二
        }
      } else {
        var ensure_name = '目标保障' //中间轴名称
        var current_name = '当前时间' //后端轴名称
        var ensure_name_time = ensure_time_date //中间轴时间
        var current_name_time = system_time_date //后端轴时间
        var time_color = '#ff3e3e'
        var percentage1 = ensure_time - qianzhan_time
        var percentage2 = system_time - ensure_time
        var percentage_total = percentage1 + percentage2
        var percentage1_val = percentage1 / percentage_total * 100 //时间轴一
        var percentage2_val = percentage2 / percentage_total * 100 //时间轴二
        if (percentage1 <= 0) {
          percentage1_val = 0
          percentage2_val = 100
        }
        if (percentage2 <= 0) {
          percentage1_val = 100
          percentage2_val = 0
        }
      }
      //时间轴程序结束
      strx += '<div  style=" background:#f2f2f2; height:4em; line-height:4em; margin-top:0.5em;">'
      strx += '<div class="ub-ac ub uinn1" style=" background:#f2f2f2">'
      strx += '<div class="umw2" style="margin-right:0.2em;font-size:0.825em; ">' + stood_name + '</div>'
      strx += '<div class="ub ub-f1">'
      strx += '<div style=" width:100%">'
      strx += '<ul class=" ub ub-ac lis zv_h ulev0" style="position:relative">'
      strx += '<li style=" width:' + percentage1_val + '%; background:#00ff00;height:1em; position:relative ">'
      strx +=
        '<div style="position:absolute;top:1em; right:0px; "><div style="background:url(images/maopao1.png) no-repeat; background-size:100%; padding:0.2em 0.3em 0.2em 0.4em; position:absolute; right:-1.5em; height:1.5em; font-size:0.8em; line-height:1.4em; padding-left:0.2em;"><div style="margin:0.36em 0.3em 0 0.3em">' +
        ensure_name_time + '</div></div></div>'
      strx +=
        '<div style="position:absolute;top:1em; right:0px; top:-1.5em"><div style="padding:0.2em 0.3em 0.2em 0.4em; position:absolute; right:-2.5em; height:1.5em; line-height:1.4em; padding-left:0.2em;font-size:0.825em; color:#789DE2;width:4.2em ">' +
        ensure_name + '</div></div>'
      strx += '</li>'
      strx += '<li style=" width:' + percentage2_val + '%; background:' + time_color + ';height:0.8em;"></li>'
      strx += '</ul>'
      strx += '</div>'
      strx += '</div>'
      strx += '<div class="umw2" style="margin-left:0.2em; line-height:1.4em;font-size:0.825em;  ">' + current_name + '</div>'
      strx += '</div>'
      strx += '<div class="ub-ac" style="position:absolute; top:1.4em;font-size:0.825em;width:100%;"><div class=" ub ub-ac uinn1"><div  style=" width:50%;">' + qianzhan_time_date + '</div><div  style=" width:50%;text-align:right">' +
        current_name_time + '</div></div></div>'
      strx += '</div>'
      strx += '<div style="background:#FFF; height:0.5em"></div>'
      strx += '</div>'
    }
    $$('monitoring_list').innerHTML = strx;
    setTimeout('myrefresh()', 180000) //三分钟后执行myrefresh方法
    Loading(-1);
  }

  function zv_block(ID) {
    IC.talkingDataCount("智能监控", "0019");
    var isExt = "0";
    var intelligent_id = $$("intelligent_id").value;
    var aearArr = intelligent_id.split(";");
    var arr = new Array();
    j = 0;
    for (var i = 0; i < aearArr.length; i++) {
      if (aearArr[i] == ID) {
        isExt = 1;
        //break;
      } else {
        arr[j] = aearArr[i];
        j++;
      }
    }
    //添加当前传入的id
    if (intelligent_id == "") {
      $$("intelligent_id").value = ID;
    } else {
      $$("intelligent_id").value = intelligent_id + ";" + ID;
    }
    document.getElementById('intelligent_none' + ID).style.display = 'block'
    document.getElementById('intelligent_block' + ID).style.display = 'none'
  }

  function zv_none(ID) {
    IC.talkingDataCount("智能监控", "0019");
    var isExt = "0";
    var intelligent_id = $$("intelligent_id").value;
    var aearArr = intelligent_id.split(";");
    var arr = new Array();
    j = 0;
    for (var i = 0; i < aearArr.length; i++) {
      if (aearArr[i] == ID) {
        isExt = 1;
        //break;
      } else {
        arr[j] = aearArr[i];
        j++;
      }
    }
    //移除当前传入id
    var str = "";
    for (var i = 0; i < arr.length; i++) {
      str += arr[i] + ";";
    }
    str = str.substring(0, (str.length - 1));
    $$("intelligent_id").value = str;
    document.getElementById('intelligent_block' + ID).style.display = 'block'
    document.getElementById('intelligent_none' + ID).style.display = 'none'
  }

  function LoadDataS(flight_time, flightDate, data_time,operationid) {
    IC.talkingDataCount("智能监控", "0019");
    localStorage.setItem("operationidzyh", operationid);
    Loading(0);
    localStorage.setItem("flight_time", flight_time);
    var wsdl = ceair_server_time_url
    var nameSpace = ceair_server_time_nameSpace
    var paras = "|";
    var values = "|";
    var method = ceair_server_time_function
    var jsonPage = [{
      'key': 'wsdl',
      'type': '0',
      'value': wsdl
    }, {
      'key': 'KEY1',
      'type': '0',
      'value': '1'
    }, {
      'key': 'KEY2',
      'type': '0',
      'value': '1'
    }, {
      'key': 'KEY3',
      'type': '0',
      'value': '1'
    }, {
      'key': 'nameSpace',
      'type': '0',
      'value': nameSpace
    }, {
      'key': 'method',
      'type': '0',
      'value': method
    }, {
      'key': 'paras',
      'type': '0',
      'value': paras
    }, {
      'key': 'values',
      'type': '0',
      'value': values
    }];
    $.getJSON(UrlClient + "&SOAPType=yes", function(json) {
      localStorage.setItem("Server_time", json);
      LoadDatas_xianbao(flightDate, data_time)
    }, "json", function(e) {}, "POST", jsonPage, false);
  }

  function LoadDataS_member() { //查询员工号
    IC.talkingDataCount("智能监控", "0019");
    //var user_name = localStorage['LoginInfor'];
    var user_name = '{"username":"chengcheng1",' + '"password":"cc_890817!",' + '"domainName":"管控领域",' + '"type":"0"}';
    user_name = '[' + user_name + ']'
    var jsonuser = strToJson(user_name)
    var user_id = jsonuser[0].username
    var jsonPage = [{
      'key': 'act',
      'type': '0',
      'value': 'GetRole'
    }, {
      'key': 'Account',
      'type': '0',
      'value': user_id
    }];
    $.getJSON(host_address_url + "GetUserInfo", function(json) {
      localStorage.setItem("score_user_id", json);
      openNewWin('intelligent_monitoring_detailed', 'intelligent_monitoring_detailed.html');
      Loading(-1);
    }, "str", function(e) {
      alert(JSON.stringify(e))
    }, "POST", jsonPage, false);
  }

  function LoadDatas_xianbao(flightDate, data_time) { //现保接口
    IC.talkingDataCount("智能监控", "0019");
    var pdate = data_time; /*日期*/
    var flightNo = flightDate;
    var carrier = flightNo.replace(/[^a-z]/ig, "")
    carrier = carrier.toUpperCase()
    var flightNo = flightNo.replace(/[^0-9]/ig, "");
    var dept = ''
    var arr = ''
    var wsdl = installed_single_models_url
    var nameSpace = installed_single_models_nameSpace
    var paras = "loginSystem|flightNo|departure|arrival|carrier|flightDate";
    var values = 'ceaMG|' + flightNo + '|' + dept + '|' + arr + '|' + carrier + '|' + pdate;
    var method = installed_single_models_function
    var jsonPage = [{
      'key': 'wsdl',
      'type': '0',
      'value': wsdl
    }, {
      'key': 'KEY1',
      'type': '0',
      'value': '1'
    }, {
      'key': 'KEY2',
      'type': '0',
      'value': '1'
    }, {
      'key': 'KEY3',
      'type': '0',
      'value': '1'
    }, {
      'key': 'nameSpace',
      'type': '0',
      'value': nameSpace
    }, {
      'key': 'method',
      'type': '0',
      'value': method
    }, {
      'key': 'paras',
      'type': '0',
      'value': paras
    }, {
      'key': 'values',
      'type': '0',
      'value': values
    }];
    $.getJSON(UrlClient + "&SOAPType=yes", function(json) {
      var jsondata = json[0].dataList
      localStorage.setItem("installed_refresh_type", "2");
      var jsonmodels_list = JSON.stringify(json);
      localStorage.setItem("jsonmodels_list", jsonmodels_list);
      LoadDataS_member()
    }, "json", function(e) {}, "POST", jsonPage, false);
  }
</script>

</html>
